using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace WorldOfMUDra
{
    public class Knife : IWeapon
    {
        string name;
        /// <summary>
        /// The name will be return followed with ('itemid')
        /// </summary>
        public string Name
        {
            get { return (name + " (" + id + ")"); }
        }

        string description;
        public string Description
        {
            get { return description; }
        }

        string id;
        public string ID
        {
            get { return id; }
        }

        string list_description;
        bool pickupable;
        public bool Obtainable
        {
            get { return pickupable; }
        }
        bool bound;

        public Knife(string name, string id)
        {

        }

        /// <summary>
        /// This should be the only constructor used for the main game. Any other constructors are for beta test only.
        /// The file should be an XML file and will be parsed for all the info used in the instance of the class.
        /// </summary>
        /// <param name="filename">The name of the XML file to be parsed.</param>
        public Knife(string filename)
        {
            XmlTextReader reader = new XmlTextReader(filename);
            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:
                        switch (reader.Name.ToLower())
                        {
                            case "name":
                                this.name = reader.ReadString().Trim();
                                break;
                            case "id":
                                this.id = reader.ReadString().Trim();
                                break;
                            case "listdescription":
                                this.list_description = reader.ReadString().Trim();
                                break;
                            case "description":
                                this.description = reader.ReadString().Trim();
                                break;
                        }
                        break;
                }
            }
        }

        public void OnFirstPickUp(Player p)
        {

        }

        public void OnLook(Player p)
        {

        }

        public void OnPickUp(Player p)
        {

        }
    }
}
